Skip to content

feat(test): add SKIP_V4 e SKIP_V5 for test#345

Open
cesco69 wants to merge 3 commits into
dimdenGD:mainfrom
cesco69:patch-8
Open

feat(test): add SKIP_V4 e SKIP_V5 for test#345
cesco69 wants to merge 3 commits into
dimdenGD:mainfrom
cesco69:patch-8

Conversation

@cesco69
Copy link
Copy Markdown
Contributor

@cesco69 cesco69 commented May 14, 2026

Add support for per-version skip markers in the test runner, allowing individual tests to skip execution against a specific Express version (v4 or v5) while still running the remaining comparisons.

Motivation

Some tests exercise features that are removed or fundamentally changed in Express 5 (e.g. app.del(), deprecated app.param() callback syntax). These tests crash Express 5 with an ERROR, adding noise to the test output. We want to skip only the problematic version and still validate against the other.

Implementation

The marker is read from the second line of each test file as a comment:

// must support app.delete() and app.del()
// SKIP_V5: app.del() removed in Express 5

Supported markers

Marker Effect
SKIP_V5: reason Skip Express 5 execution, compare ultimate-express strictly against Express 4
SKIP_V4: reason Skip Express 4 execution, compare ultimate-express strictly against Express 5
OFF: reason Skip the entire test (t.skip())

Diagnostic output

When a version is skipped, the runner emits a diagnostic with the reason:

# express5: SKIPPED (app.del() removed in Express 5)

Behavior

  • Only the second line is checked for markers SKIP_V4, SKIP_V5 and OFF (regex: ^\/\/\s*(SKIP_V4|SKIP_V5|OFF)(?::\s*(.*))?$)
  • Case-sensitive matching
  • Tests without a marker on line 2 run all three versions as before (backward compatible)
  • The reason after : is optional but recommended for documentation

Test changed

  • tests/tests/app/app-delete.js — annotated with SKIP_V5
  • tests/tests/app/app-param-deprecated.js — annotated with SKIP_V5

@cesco69 cesco69 marked this pull request as ready for review May 14, 2026 08:43
@cesco69
Copy link
Copy Markdown
Contributor Author

cesco69 commented May 14, 2026

@dimdenGD Do we really want to try to support Express 5? With this PR, we can run tests that can only run on v4 or v5 (or both), allowing us to try to support both in the same branch.

If we can support both (v4 and v5), would you accept PRs?

@nigrosimone
Copy link
Copy Markdown
Contributor

I think it should be possible to support both V4 and V5 in the same branch, but only if we add some kind of option that allows us to determine whether the framework should behave as V4 or V5.

For example:

const express = require("ultimate-express");

const app = express({ version: 5 }); // default is 4

Some behaviors changed in V5, so we need a way to handle things differently depending on the version we want to support.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants